Code Analyses for Refactoring by Source Code Patterns and Logical Queries
نویسندگان
چکیده
Preconditions of refactorings often comprise complex analyses that require a solid formal basis. The bigger the gap between the level of abstraction of the formalism and the actual implementation is, the harder the coding and maintenance of the analysis will be. In this paper we describe a subset of GenTL, a generic analysis and transformation language. It balances the need for expressiveness, high abstractness and ease of use by combining the full power of a logic language with easily accessible definitions of source code patterns. We demonstrate the advantages of GenTL by implementing the analyses developed by Tip, Kiezun and Bäumer for generalizing type constraints [11]. Our implementation needs just a few lines of code that can be directly traced back to the formal rules.
منابع مشابه
Elemental Design Patterns: A Logical Inference System and Theorem Prover Support for Flexible Discovery of Design Patterns
Previous approaches to discovering design patterns in source code have suffered from a need to enumerate static descriptions of structural and behavioural relationships, resulting in a finite library of variations on pattern implementation. Our approach differs in that we do not seek to statically encode each pattern, and each variant, that we wish to find. Rather, we encode in a formal denotat...
متن کاملSPQR: Use of a First-Order Theorem Prover for Flexibly Finding Design Patterns in Source Code
Previous approaches to discovering design patterns in source code have suffered from a need to enumerate static descriptions of structural and behavioural relationships, resulting in a finite library of variations on pattern implementation. Our approach, System for Pattern Query and Recognition, or SPQR, differs in that we do not seek statically to encode each pattern and each variant that we w...
متن کاملSPQR: Flexible Automated Design Pattern Extraction From Source Code
Previous automated approaches to discovering design patterns in source code have suffered from a need to enumerate static descriptions of structural and behavioural relationships, resulting in a finite library of variations on pattern implementation. Our approach, System for Pattern Query and Recognition, or SPQR, differs in that we do not seek statically to encode each pattern and each variant...
متن کاملSource-code queries with graph databases - with application to programming language usage and evolution
Program querying and analysis tools are of growing importance, and occur in two main variants. Firstly there are source-code query languages which help software engineers to explore a system, or to find code in need of refactoring as coding standards evolve. These also enable language designers to understand the practical uses of language features and idioms over a software corpus. Secondly the...
متن کاملAn Investigation into the Characteristics of Merged Code Clones during Software Evolution
Although code clones (i.e. code fragments that have similar or identical code fragments in the source code) are regarded as a factor that increases the complexity of software maintenance, tools for supporting clone refactoring (i.e. merging a set of code clones into a single method or function) are not commonly used. To promote the development of refactoring tools that can be more widely utiliz...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007